﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OnCommon
{
    public enum PacketType : int
    {
        /// <summary>
        /// 字符串
        /// </summary>
        String = 1,
        /// <summary>
        /// 二进制流
        /// </summary>
        Binary = 2,
        /// <summary>
        /// 序列化对象
        /// </summary>
        Complex = 3,
        /// <summary>
        /// 文件传输，分段读取，分段存储
        /// </summary>
        File = 4
    }
    /// <summary>
    /// size : 12
    /// </summary>
    [System.Diagnostics.DebuggerDisplay("Len={Length},Type:{PacketType}")]
    public struct Packet
    {
        //public int Version { get { return 1; } }
        public int Length { get; set; }
        public PacketType PacketType { get; set; }

        public override string ToString()
        {
            return String.Format("V:{0},Len:{1},Type:{2}.", 1, Length, PacketType.ToString());
        }
    }

}
